package com.spring.test;

import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

public class CollectionInjection {

    private List<String> list;

    private Set<String> set;

    private Map<String, String> map;

    private Properties props;

    public List<String> getList() {
        return list;
    }

    public void setList(List<String> list) {
        this.list = list;
    }

    public Set<String> getSet() {
        return set;
    }

    public void setSet(Set<String> set) {
        this.set = set;
    }

    public Map<String, String> getMap() {
        return map;
    }

    public void setMap(Map<String, String> map) {
        this.map = map;
    }

    public Properties getProps() {
        return props;
    }

    public void setProps(Properties props) {
        this.props = props;
    }

    public void printList() {
        StringBuffer strBuf = new StringBuffer();
        for (int i = 0; i < this.list.size(); i++) {
            strBuf.append("NO : " + i + "  =  " + this.list.get(i) + "\n");
        }
        System.out.println(strBuf.toString());
    }

    @SuppressWarnings("rawtypes")
    public void printSet() {
        StringBuffer strBuf = new StringBuffer();
        Iterator iterator = this.set.iterator();

        int i = 0;
        while (iterator.hasNext()) {
            strBuf.append("NO : " + i + "  =  " + iterator.next() + "\n");
            i++;
        }
        System.out.println(strBuf.toString());
    }

    public void pringMap() {
        StringBuffer strBuf = new StringBuffer();

        for (String key : this.map.keySet()) {
            strBuf.append(key + "  =  " + this.map.get(key) + "\n");
        }
        System.out.println(strBuf.toString());
    }
}
